// Fireworks JavaScript Command // Copy to Fireworks/Configuration/Commands/ // Aaron Beall - http://abeall.com // Version 1.0 var dom = fw.getDocumentDOM(); // document object var sel = new Array().concat(fw.selection); // saved selection function IncisionPaths() { if (!sel.length) return false; var origPaths = []; dom.ungroup(); for (s in sel) if (sel[s] == '[object Path]' ) origPaths.push(sel[s]); if (origPaths.length < 2) return false; fw.selection = origPaths; var newPaths = []; // punch paths dom.cloneSelection(); dom.pathPunch(); if(fw.selection.length) newPaths = newPaths.concat(fw.selection); // crop fw.selection = origPaths; dom.pathCrop(); newPaths = newPaths.concat(fw.selection); // move all to same layer, split, select all, move back fw.selection = newPaths; var oldLayerNum = dom.currentLayerNum; dom.addNewLayer(null, false); var tempLayerNum = dom.currentLayerNum; dom.moveSelectionToLayer(tempLayerNum, false, 'none', -1); dom.splitPaths(); dom.selectAllOnLayer(tempLayerNum, false, 'none', -1); dom.moveSelectionToLayer(oldLayerNum, false, 'none', -1); dom.deleteLayer(tempLayerNum); return true; } IncisionPaths();